<%-- 
    Document   : negozio
    Created on : 15-mag-2014, 11.33.14
    Author     : cloud
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script>
    function addToCart(prod) {
    var url = "getProdData?p="+prod;
    xhrObj.open("GET", url, true);
    xhrObj.onreadystatechange = displayCart;
    xhrObj.send(null);
    }

    function displayCart() {
    if(xhrObj.readyState == 4) {
    document.getElementById("carrello").innerHTML = xhrObj.responseText;
    }
    }
var xhrObj = new XMLHttpRequest();
    </script>
    </head>
    <body>
    <h1>Benvenuto!</h1>
    <h3>Selezionare i prodotti desiderati:</h3>
    
    Crema intensiva giorno – 19.50
    <A HREF="" onClick="addToCart('1'); return false;">
    acquista</A>
    <BR>
    Crema intensiva notte – 27.50
    <A HREF="" onClick="addToCart('2'); return false;">
    acquista</A>
    <P>CARRELLO</P>
    <P ID="carrello">vuoto</P>
    </body>
</html>
